package org.exez.modules.visitor.constant;

/**
 * 甬行码颜色
 *
 * @author dtm
 */
public enum CodeColourEnum {
    green("绿码", 1,"green"),
    yellow("黄码", 2,"yellow"),
    red("红码", 1,"red");
    private String name;
    private Integer index;
    private String value;

    private CodeColourEnum(String name, Integer index, String value) {
        this.name = name;
        this.index = index;
        this.value = value;
    }

    public static String getName(Integer index) {
        for (CodeColourEnum c : CodeColourEnum.values()) {
            if (c.getIndex().equals(index)) {
                return c.name;
            }
        }
        return null;
    }
    public static String getValue(Integer index) {
        for (CodeColourEnum c : CodeColourEnum.values()) {
            if (c.getIndex().equals(index)) {
                return c.value;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }


    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
